import { request } from './request';
export{
  GetCourse,//获取课程信息
  login,//登录注册
  bindAdmin,//绑定管理员账号
  GetActivity,//获取管理员活动列表
  addActivity,//管理员添加活动
  getGradeMajor,//获取年级与专业
  GetSignDetail,//获取签到详情
  JoinActivity,//参与活动
  CancelJoin,//取消参与
  GetJoinData,//获取参与记录
  GetJoinAccount,//获取参与人数
  GetStudentData,//获取参与学生信息
  getGradeClasses,//获取 年级与其班级
  updateUserInfo,
  SignIn,//签到
  uploadJoin,//学生参加活动申报
  uploadPrize,//学生获奖申报
  uploadlist,//学生申报记录
  fileUrl,//学生获奖文件储存路径
  GetJoinActivity,//获取学生参与的活动
  AddLook,//学生处理活动
  SAddLook,//学生处理申报活动
  GetSignHistory,//获取签到记录
  GetNotice,//获取通知列表
  addNotice,//管理员发布通知
  AddNoticeLook,//学生处理通知
}

/**
 * @function 获取课程信息
 */
const GetCourse = (data: {userId:number}) => {
  return request({
    url: 'GetCourse',
    method: 'GET',
    data: data,
  })
}
const login = (data:{code:string})=>{
  return request({
    url: 'Login',
    method: 'GET',
    data: data,
  })
}
const bindAdmin = (data:{name:string,code:string,wx_code:string})=>{
  return request({
    url: 'BindAdmin',
    method: 'GET',
    data: data,
  })
}
//getGradeClasses
const getGradeClasses = ():any=>{
  return request({
    url: 'getGradeClasses',
    method: 'GET',
    data: {},
  })
}

const updateUserInfo = (data:{name:string,code:string,class_id:number,userId:number}):any=>{
  return request({
    url: 'updateUserInfo',
    method: 'GET',
    data: data,
  })
}
//GetSignDetail
const GetSignDetail= (data:{other_id:string | number,other_type:string}):any=>{
  return request({
    url: 'GetSignDetail',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 签到
 */
const SignIn=(data:{sign_id:number | string ,other_id:number | string, name:string ,code:string ,week:number | '',type:'正常签到' | '迟到',s_type:'课程'|'活动'}):any=>{
  return request({
    url: 'SignIn',
    method: 'GET',
    data: data,
  })
}
/**
 * @function 获取活动列表
 */
const GetActivity = (data:{class_id:number,s_code:string})=>{
  return request({
    url: 'GetActivity',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 管理员添加活动
 */
const addActivity = (data:{title:string,place:string,start_time:string,end_time:string,people:string,content:string,grade:string,major:string}):any=>{
  return request({
    url: 'addActivity',
    method: 'GET',
    data: data,
  })
}

//getGradeMajor
const getGradeMajor = ():any=>{
  return request({
    url: 'getGradeMajor',
    method: 'GET',
    data: {},
  })
}

/**
 * @function 参加活动
 */
const JoinActivity = (data:{title:string,a_id:number,s_name:string,s_code:string,class_id:number,c_name:string}):any=>{
  return request({
    url: 'JoinActivity',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 取消参加
 */
const CancelJoin = (data:{s_code:string,a_id:number}):any=>{
  return request({
    url: 'CancelJoin',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 获取参加记录
 */
const GetJoinData = (data:{s_code:string,a_id:number}):any=>{
  return request({
    url: 'GetJoinData',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 获取参加人数
 */
const GetJoinAccount = (data:{a_id:number}):any=>{
  return request({
    url: 'GetJoinAccount',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 获取参与学生信息
 */
const GetStudentData = (data:{a_id:number}):any=>{
  return request({
    url: 'GetStudentData',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 学生参加活动申报
 */
const uploadJoin = (data:{title:string,place:string,start_time:string,end_time:string,people:string,s_name:string,s_code:string}):any=>{
  return request({
    url: 'uploadJoin',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 学生获奖申报
 */
const uploadPrize = (data:{title:string,place:string,people:string,filepath:string,s_name:string,s_code:string}):any=>{
  return request({
    url: 'uploadJoin',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 学生申报记录
 */
const uploadlist = (data:{s_name:string,s_code:string}):any=>{
  return request({
    url: 'uploadlist',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 学生获奖文件储存路径
 */
const fileUrl = (data:{a_id:number,s_code:string,filepath:string}):any=>{
  return request({
    url: 'fileUrl',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 获取学生参与的活动
 */
const GetJoinActivity = (data:{s_code:string}):any=>{
  return request({
    url: 'GetJoinActivity',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 学生处理活动
 */
const AddLook = (data:{a_id:number,s_code:string}):any=>{
  return request({
    url: 'AddLook',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 学生处理申报活动
 */
const SAddLook = (data:{a_id:number,s_code:string}):any=>{
  return request({
    url: 'SAddLook',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 获取签到记录
 */
const GetSignHistory = (data:{name:string,code:string}):any=>{
  return request({
    url: 'GetSignHistory',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 获取通知列表
 */
const GetNotice = (data:{class_id:number,s_code:string})=>{
  return request({
    url: 'GetNotice',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 管理员发布通知
 */
const addNotice = (data:{title:string,time:string,people:string,content:string,grade:string,major:string}):any=>{
  return request({
    url: 'addNotice',
    method: 'GET',
    data: data,
  })
}

/**
 * @function 学生处理通知
 */
const AddNoticeLook = (data:{n_id:number,s_code:string}):any=>{
  return request({
    url: 'AddNoticeLook',
    method: 'GET',
    data: data,
  })
}